<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<script src="../vue.js"></script>

<body>

  <div id="app">
    <a href="#" @click.prevent="flag ? flag : flag= !flag">loginPage</a>
    <a href="#" @click.prevent="flag ?flag= !flag : flag">registerPage</a>
    <login v-if="flag"></login>
    <register v-else="flag"></register>
  </div>

  <script>
    Vue.component("login", {
      template: "<div>LoginPage</div>"
    })
    Vue.component("register", {
      template: "<div>RegisterPage</div>"
    })
    const vm = new Vue({
      el: "#app",
      data: {
        flag: true,
      }
    })
  </script>
</body>

</html>